﻿using System;
using System.Collections.Generic;
using System.Text;
using Eudaemon.ProeAssist.Core;

namespace Eudaemon.ProeAssist.TestConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            //TestDirectoryWalker();
           TestProeFile();
           //TestProeFileType();
            Console.ReadLine();
        }
        static void TestProeFileType()
        {
            ProeFileType fileType = new ProeAssemblyType();
            Console.WriteLine(fileType.Name);
            Console.WriteLine(fileType.Abbreviation);
            //Console.WriteLine(fileType.IconResource);
        }

        static void TestProeFile()
        {
            ProeFileBundle files = new ProeFileBundle("good.prt.1");
            //ProeFileBundle files = new ProeFileBundle("good", new ProeAssemblyType(), 3);
            files.Add(2);
            files.Add(20);
            files.Add(-1);
            Console.Write("The file is " + files.FileName + "." + files.FileType.Abbreviation + ": ");
            Console.WriteLine();
            Console.WriteLine("The newest version is " + files.NewestVersion);

        }

        static void TestDirectoryWalker()
        {
            DirectoryWalker walker = new DirectoryWalker();
            Console.WriteLine("Current path before adds any path: " + walker.CurrentPath);
            walker.Add("0 path");
            walker.Add("First path");
            walker.Add("2nd path");
            walker.Add("3rd path");
            Console.WriteLine("Current path after adds 4 paths: " + walker.CurrentPath);
            walker.Add("4 path");
            walker.Add("5 path");
            walker.Add("6 path");
            walker.Add("7 path");
            walker.Add("8 path");
            walker.Add("9 path");
            walker.Add("10 path");
            walker.Add("11 path");
            walker.Add("12 path");
            walker.Add("13 path");
            walker.Add("14 path");
            walker.Add("15 path");
            Console.WriteLine("Current path after adds 16 paths: " + walker.CurrentPath);
            // first one should be removed 
            walker.Add("16 path");
            Console.WriteLine("Current path after adds 17 paths: " + walker.CurrentPath);
            walker.MovePrevious();
            walker.MovePrevious();
            walker.MovePrevious();
            walker.MovePrevious();
            Console.WriteLine("Current path after move to previous: " + walker.CurrentPath);
            walker.MoveNext();
            Console.WriteLine("Current path after move to previous 4 times, then next: " + walker.CurrentPath);
            walker.Add("New inserted path");
            Console.WriteLine("Current path after insert: " + walker.CurrentPath);
            walker.MoveNext();
            Console.WriteLine("Current path after insert then move next: " + walker.CurrentPath);
            Console.WriteLine("Max paths number: " + walker.MaxPathNumber);
            string path = @"C:\tt\cc";
            walker.Add(path);
            walker.UpLevel();
            Console.WriteLine("Current path after move upper: " + walker.CurrentPath);
        }
    }
}
